/* public/style.css (v5.5 - 优化版) */
body, html {
    height: 100%;
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: #f0f2f5;
    overflow: hidden;
}

.main-container { display: flex; width: 100%; height: 100%; }
.sidebar { width: 280px; background-color: #f7f7f7; border-right: 1px solid #e0e0e0; display: flex; flex-direction: column; transition: width 0.3s; }
.sidebar-header { padding: 16px; border-bottom: 1px solid #e0e0e0; background-color: #fff; }
.sidebar-header h2 { margin: 0 0 12px 0; font-size: 16px; color: #333; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-input-container input { width: 100%; padding: 10px; border: 1px solid #ccc; border-radius: 6px; box-sizing: border-box; font-size: 14px; background: #f0f2f5; }
.chat-input-container input:focus { border-color: #1890ff; background: #fff; }
.chat-list { list-style: none; padding: 0; margin: 0; overflow-y: auto; flex-grow: 1; }
.chat-list li { padding: 12px 16px; cursor: pointer; border-bottom: 1px solid #e8e8e8; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; position: relative; color: #555; }
.chat-list li:hover { background-color: #efefef; }
.chat-list li.active { background-color: #e6f7ff; border-right: 3px solid #1890ff; font-weight: 600; color: #1890ff; }
.chat-area { flex-grow: 1; display: flex; flex-direction: column; background-color: #fff; }
.chat-header { padding: 12px 16px; border-bottom: 1px solid #e0e0e0; display: flex; align-items: center; background: #fff; z-index: 10; flex-shrink: 0; }
#current-chat-title { margin: 0; font-size: 16px; font-weight: 600; flex-grow: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.status-indicator { width: 10px; height: 10px; border-radius: 50%; background-color: #ff4d4f; transition: background-color 0.3s; margin-left: 10px; }
.status-indicator.connected { background-color: #52c41a; }
.icon-btn { background: none; border: none; cursor: pointer; font-size: 16px; color: #888; padding: 5px; margin-left: 10px; }
.icon-btn:hover { color: #333; }
.chat-messages { flex-grow: 1; padding: 16px; overflow-y: auto; display: flex; flex-direction: column-reverse; }
.message { display: flex; margin-bottom: 16px; max-width: 80%; align-items: flex-start; }
.message .avatar { width: 36px; height: 36px; border-radius: 50%; margin-right: 12px; flex-shrink: 0; }
.message-content { display: flex; flex-direction: column; }
.sender-name { font-weight: 600; font-size: 13px; margin-bottom: 4px; color: #555; }
.text { background-color: #f0f2f5; padding: 10px 14px; border-radius: 18px; font-size: 15px; line-height: 1.5; word-wrap: break-word; color: #000; }
.message.system-message { align-self: center; background-color: #fafafa; color: #888; padding: 8px 12px; border-radius: 12px; font-size: 12px; max-width: none; }

/* Modal Styles */
.modal { display: none; position: fixed; z-index: 1000; left: 0; top: 0; width: 100%; height: 100%; overflow: auto; background-color: rgba(0,0,0,0.4); animation: fade-in 0.3s; }
.modal-content { background-color: #fefefe; margin: 10% auto; padding: 0; border: 1px solid #888; width: 90%; max-width: 700px; border-radius: 8px; box-shadow: 0 5px 15px rgba(0,0,0,0.3); animation: slide-down 0.3s; }
.modal-header { padding: 16px 24px; background-color: #f7f7f7; border-bottom: 1px solid #e0e0e0; display: flex; justify-content: space-between; align-items: center; }
.modal-header h2 { margin: 0; font-size: 18px; }
.close-btn, .close-cookie-helper { color: #aaa; font-size: 28px; font-weight: bold; cursor: pointer; }
.close-btn:hover, .close-cookie-helper:hover { color: #000; }
.modal-body { padding: 24px; max-height: 70vh; overflow-y: auto; }
.tabs { overflow: hidden; border-bottom: 1px solid #ccc; margin-bottom: 20px; }
.tab-link { background-color: inherit; float: left; border: none; outline: none; cursor: pointer; padding: 14px 16px; transition: 0.3s; font-size: 16px; }
.tab-link:hover { background-color: #ddd; }
.tab-link.active { background-color: #fff; border: 1px solid #ccc; border-bottom: 1px solid #fff; margin-bottom: -1px; border-top-left-radius: 4px; border-top-right-radius: 4px; }
.tab-content { display: none; }
.form-group { margin-bottom: 20px; }
.form-group label { display: block; margin-bottom: 8px; font-weight: 600; color: #333; }
.form-control, .form-group input, .form-group textarea, .form-group select { width: 100%; padding: 10px; box-sizing: border-box; border: 1px solid #ccc; border-radius: 4px; font-family: monospace; font-size: 13px; resize: vertical; }
.form-group select { font-family: -apple-system, sans-serif; }
.help-text { font-size: 12px; color: #888; margin-top: 6px; }
.save-btn { background-color: #1890ff; color: white; padding: 10px 15px; border: none; border-radius: 4px; cursor: pointer; font-size: 16px; }
.save-btn:hover { background-color: #40a9ff; }
.save-btn.secondary { background-color: #f0f2f5; color: #333; border: 1px solid #d9d9d9; }
.save-btn.secondary:hover { background-color: #e6f7ff; border-color: #1890ff; }
.button-group { display: flex; gap: 10px; flex-wrap: wrap; }
.profile-controls { display: flex; align-items: center; gap: 10px; }
.profile-controls select { flex-grow: 1; }
.cookie-container { display: flex; gap: 10px; align-items: flex-start; }
.cookie-container textarea { flex-grow: 1; }
.cookie-container button { flex-shrink: 0; }
.modal-body pre { background-color: #eee; padding: 10px; border-radius: 4px; white-space: pre-wrap; word-break: break-all; }
.modal-body code { font-family: monospace; }
hr { border: 0; border-top: 1px solid #e8e8e8; margin: 24px 0; }

@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes slide-down { from {transform: translateY(-50px); opacity: 0;} to {transform: translateY(0); opacity: 1;} }
